home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 4.2 / arexx / toasterpaint / copyclip.rexx < prev    next >
OS/2 REXX Batch file  |  1998-04-16  |  3KB  |  102 lines

  1. /* CopyClip.rexx V2.0 -- This will copy a clip.      */
  2. /* By Bob Caron © 1995 NewTek Inc.                   */
  3. /* Originaly by David Holt.                          */
  4.  
  5. parse arg InClipName","OutClipName","StartField","EndField
  6.  
  7. Address "DigiPaint"
  8. options results
  9.  
  10.  
  11. if InClipName="" & OutClipName="" then do
  12.  'Askb'"This only works;from process clip."
  13.  exit
  14.  end
  15.  
  16. IFFBaseName=OutClipName
  17. if EndField="" then do
  18.  'Askb'"Please select;A source clip."
  19.  exit
  20.  end
  21.  
  22. if ~show('l','rexxsupport.library') then do
  23.   if ~addlib('rexxsupport.library',0,-30,34) then do
  24.     exit
  25.   end
  26. end
  27.  
  28. PageWide=752
  29. PageHigh=480
  30. dots=0
  31. XWin = 100
  32. YWin = 40
  33. Clear = d2c(12)
  34. nv = ''
  35. cr = '0a'x
  36. call getfontsize
  37.  
  38. wid = width*48
  39. hei = theight+height*10
  40.  
  41. if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/CopyClip Script V2.0 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then do
  42.    exit
  43. end
  44.  
  45.  
  46.  endfield=(StartField+(EndField-StartField)/2)
  47.  do Frame = StartField to EndField
  48.         call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  49.         'Gnfd'                                                  /* Get the next field to process */
  50.         call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  51.         'Apfc'                                                  /* Append the field to clip */
  52.         call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  53.         'Gnfd'                                                  /* Get the next field to process */
  54.         call OpenWindow(InclipName,OutClipName,frame,Endfield,Frame)
  55.         'Apfc'                                                  /* Append the field to clip */
  56.  end
  57.         'Iclp'                                                  /* Add an flyer icon to this clip */
  58. exit
  59.  
  60. OpenWindow:
  61. parse arg InclipName,OutClipName,currentframe,EndFrame,Frame
  62.   pdots="...."
  63.   dots=dots+1
  64.   if dots>4 then dots=1
  65.   call writech('Window',Clear||nv||cr)
  66.   call writech('Window','Current Source Clip ['InClipName']'cr)
  67.   call writech('Window','  Current Dest Clip ['OutClipName']'cr)
  68.   call writech('Window',''cr)
  69.   call writech('Window','Current Frame: 'Frame/2''cr)
  70.   call writech('Window','    End Frame:'EndFrame/2''cr)
  71.   call writech('Window',''cr)
  72.   call writech('Window','Processing'right(pdots,dots)||cr)
  73.  
  74. return
  75.  
  76. getfontsize:
  77.  
  78. if open('font','env:sys/font.prefs','R') then do
  79.    font = readch('font',word(statef('env:sys/font.prefs'),2))
  80.    call close('font')
  81.    font = substr(font,index(font,'FONT')+4)
  82.    font = substr(font,index(font,'FONT')+4)
  83.    height = c2d(substr(font,29,2))
  84.    tfont = substr(font,index(font,'FONT')+4)
  85.    theight = c2d(substr(tfont,29,2))
  86.    font = substr(font,33)
  87.    font = left(font,index(font,d2c(0))-1-5)
  88.    if open('font','FONTS:'font'/'height,'R') then do
  89.       width = c2d(right(readch('font',116),2))
  90.       call close('font')
  91.   end
  92.   else if height=9 then width = 10
  93.                    else width = 8
  94. end
  95.   else do
  96.   theight = 8
  97.   height = 8
  98.   width = 8
  99. end
  100.  
  101. return
  102.